//
// Created by TATO on 2025/8/14.
//

#ifndef HTTPSERVER_ARR_H
#define HTTPSERVER_ARR_H
#include <stdio.h>
#include "tree.h"
static inline noder mapSel(Leader *leader, char *key) {
    return RBtreenodesel(leader, key);
}

static inline int mapDel(Leader *leader, char *key) {
    return RBtreenodedel(leader, key);
}

static inline void mapAdd(Leader *leader, char *key, void *value) {
    do{             // 只要有修改的可能就要删除再添加，防止野指针问题
        mapDel(leader, key);
    } while (!RBtreenodeadd(leader, key, value));
}
#endif //HTTPSERVER_ARR_H
